<template>
    <div class="big-digit" :class="{ 'no-bg': value === '.' }">
        <img class="bg" src="./assets/border.svg" alt="">
        <Transition name="switch">
            <div class="content" :key="value">
                {{ value }}
            </div>
        </Transition>
    </div>
</template>

<script>
import { defineComponent } from 'vue'
export default defineComponent({
    props: {
        value: String,
    }
})

</script>

<style scoped>
.switch-enter {
    opacity: 0;
    transform: translateY(100%);
}
.switch-enter-to {

}
.switch-enter-active, .switch-leave-active {
    transition: all 500ms;
    position: absolute;
}
.switch-leave {

}
.switch-leave-to {
    opacity: 0;
    transform: translateY(-100%);
}

.big-digit {
    height: 3.75rem;
    width: 2.6875rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    user-select: none;
    pointer-events: none;
}

.content {
    font-family: 'OPPOSans';
    font-style: normal;
    font-weight: 400;
    font-size: 2.5rem;

    color: #FBE5BB;
    text-shadow: 0px 0px 6px rgba(251, 229, 187, 0.4);
    text-align: center;
}

.big-digit.no-bg {
    width: 1.125rem;
}

.no-bg .bg {
    display: none;
}

.no-bg .content {
    font-weight: 700;
}
</style>